﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MultiplyTableForProst
{
    public class Program
    {
        static void Main(string[] args)
        {
            int enteredNumber = 0;

            while(enteredNumber <= 1)
            {
                Console.WriteLine("Введите целое число больше 1:");
                enteredNumber = Convert.ToInt32(Console.ReadLine());
            }

            var multiplayTables = new NumericAndMultiplyTableCollection(enteredNumber);
            var mult = multiplayTables.NumericAndTables;

            for (int i = 0; i <= multiplayTables.NumericAndTables.Count-1; i++)
            {
                Console.WriteLine("Таблица умножения на " + mult[i].Numeric + "\n");

                for (int j = 0; j <= mult[i].MultiplyTable.Count-1; j++ )
                {
                    var multiply = mult[i].MultiplyTable[j];
                    Console.WriteLine(multiply.A + " * " +
                        multiply.B + " = " +
                        multiply.Result);
                }
            }

            Console.Read();
        }

    }
}
